const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "自增id",
      field: "id"
    },
    platform: {
      type: DataTypes.CHAR(30),
      allowNull: false,
      defaultValue: "pc",
      primaryKey: false,
      autoIncrement: false,
      comment: "所属平台（pc PC网站, h5 H5手机网站, ios 苹果APP, android 安卓APP, alipay 支付宝小程序, weixin 微信小程序, baidu 百度小程序, toutiao 头条小程序, qq QQ小程序）",
      field: "platform"
    },
    event_type: {
      type: DataTypes.INTEGER(4),
      allowNull: false,
      defaultValue: "-1",
      primaryKey: false,
      autoIncrement: false,
      comment: "事件类型（0 WEB页面, 1 内部页面(小程序或APP内部地址), 2 外部小程序(同一个主体下的小程序appid), 3 打开地图, 4 拨打电话）",
      field: "event_type"
    },
    event_value: {
      type: DataTypes.CHAR(255),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "事件值",
      field: "event_value"
    },
    images_url: {
      type: DataTypes.CHAR(255),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "图片地址",
      field: "images_url"
    },
    name: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "名称",
      field: "name"
    },
    is_enable: {
      type: DataTypes.INTEGER(3).UNSIGNED,
      allowNull: false,
      defaultValue: "1",
      primaryKey: false,
      autoIncrement: false,
      comment: "是否启用（0否，1是）",
      field: "is_enable"
    },
    bg_color: {
      type: DataTypes.CHAR(30),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "css背景色值",
      field: "bg_color"
    },
    sort: {
      type: DataTypes.INTEGER(3).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "排序",
      field: "sort"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    },
    upd_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "更新时间",
      field: "upd_time"
    }
  };
  const options = {
    tableName: "sxo_quick_nav",
    comment: "",
    indexes: [{
      name: "platform",
      unique: false,
      type: "BTREE",
      fields: ["platform"]
    }, {
      name: "is_enable",
      unique: false,
      type: "BTREE",
      fields: ["is_enable"]
    }, {
      name: "sort",
      unique: false,
      type: "BTREE",
      fields: ["sort"]
    }]
  };
  const SxoQuickNavModel = sequelize.define("sxo_quick_nav_model", attributes, options);
  return SxoQuickNavModel;
};